#define _CRT_SECURE_NO_WARNINGS
#if 1
//1.C version
#include<stdio.h>
int main()
{
	int a, b, c, n, count = 1,flag;
	while (scanf("%d%d%d", &a, &b, &c) != EOF)
	{
		flag = 1;
		for (int i = 0;i < 34; i++)
		{
			
			n = 3 * i + a;
			if (n % 5 == b && n % 7 == c && n > 10 && n < 100)
			{
				printf("Case %d:%d\n", count, n);
				flag = 0;
			}
			
		}
		if (flag)
		{
			printf("Case %d:No answer\n",count);
		}
		count++;
	}
	return 0;
}
#endif
#if 0
//2.C++ version
# include <iostream>
using namespace std;
int main() 
{
	int a, b, c, flag = 0, count = 0;
	while (cin >> a >> b >> c) 
	{
		count++;
		flag = 1;
		for (int i = 0; i < 34; i++) 
		{
			int num = 3 * i + a;
			if (num % 5 == b && num % 7 == c && num > 0 && num < 100) 
			{
				cout << "Case " << count << ": " << num << endl;
				flag = 0;
			}
		}
		if (flag)
		{
			cout << "Case " << count << ": " << "NO answer" << endl;
		}
	}
}
#endif
